package logic.common.game;

import gameStates.absGamesStates.AbsIngameState;
import interfaces.hud.BasicHUD;
import interfaces.hud.topWindows.ConquestStatusWindow;

import logic.common.game.endConditions.TicketsCondition;
import logic.common.game.endConditions.TimeOutCondition;
import logic.common.team.Team;

import org.fenggui.StandardWidget;

public class ConquestSetup extends GameSetup {
	
	public ConquestSetup(Game game) {
		super(game);
		
		int tickets = game.getGameCycle().getTickets();
		game.getTeamA().setTickets(tickets);
		game.getTeamB().setTickets(tickets);
	}
	
	@Override
	public void setupGame(AbsIngameState ingameState) {
		initAI();
		
		attachMotherShips(ingameState);
		attachSpawnStations(ingameState);
		
		new TicketsDegrader(game, ingameState);
	}
	
	@Override
	public void addStandardMissions(Team team, Team enemyTeam) {
		initSpawnStationMissions(team, enemyTeam);
	}
	
	@Override
	public void initEndConditions() {
		new TimeOutCondition(game);
		new TicketsCondition(game);
	}
	
	@Override
	public StandardWidget getTopHUDElement(BasicHUD hud) {
		return new ConquestStatusWindow(game, hud);
	}
	
	@Override
	public boolean hasMissions() { return true; }
	
	@Override
	public boolean hasMotherShips() { return true; }
	
	@Override
	public boolean hasTeamStatusWindow() { return false; }
}